package org.garbagecan.springstudy.beansfactory;

import java.util.List;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MyIdProviderManager {
	
	private String name;
	
	private List<MyIdProvider> myIdProviders;
	
	public static void main(String[] args) throws Exception {
		ApplicationContext ctx = new ClassPathXmlApplicationContext("/org/garbagecan/springstudy/beansfactory/spring-provider.xml");
		MyIdProviderManager manager = (MyIdProviderManager) ctx.getBean("myIdProviderManager");
		System.out.println(manager.getName());
		
		List<MyIdProvider> myIdProviders2 = manager.getMyIdProviders();
		for (MyIdProvider myIdProvider : myIdProviders2) {
			System.out.println(myIdProvider.getId());
		}
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public List<MyIdProvider> getMyIdProviders() {
		return myIdProviders;
	}

	public void setMyIdProviders(List<MyIdProvider> myIdProviders) {
		this.myIdProviders = myIdProviders;
	}

}
